From 827219e2144f4dab0e5b98d761f35361a8ee504a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 19 Jul 2018 17:57:19 -0400 Subject: [PATCH] Emoji chooser: Also check for hex boxes We don't want to see those either. --- gtk/gtkemojichooser.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c index ad722e4a1b..1ea0cfc337 100644 --- a/gtk/gtkemojichooser.c +++ b/gtk/gtkemojichooser.c @@ -373,7 +373,8 @@ add_emoji (GtkWidget *box, pango_layout_get_extents (layout, &rect, NULL); /* Check for fallback rendering that generates too wide items */ - if (rect.width >= 1.5 * chooser->emoji_max_width) + if (pango_layout_get_unknown_glyphs_count (layout) > 0 || + rect.width >= 1.5 * chooser->emoji_max_width) { gtk_widget_destroy (label); return; @@ -610,7 +611,8 @@ gtk_emoji_chooser_init (GtkEmojiChooser *chooser) /* Get a reasonable maximum width for an emoji. We do this to * skip overly wide fallback rendering for certain emojis the * font does not contain and therefore end up being rendered - * as multiply glyphs. */ + * as multiply glyphs. + */ { PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (chooser), "🙂"); PangoAttrList *attrs; -- 2.30.2